package com.woorigil.social.worker.ordering;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.woorigil.social.domain.category.Category;
import com.woorigil.social.domain.category.CategoryDao;

@Component
public class DealOrderingManager {
	public static final int ONE_DEPTH = 1;
	@Autowired CategoryDao categoryDao;
	@Autowired DealOrdering dealOrdering;
	
	public void manage() {
		List<Category> mainCategories = categoryDao.selectListByLevel(ONE_DEPTH);
		for (Category category : mainCategories) {
			dealOrdering.execute(category.getId());
		}
	}
}
